//
//  AppDelegate.m
//  SulitLoan
//
//  Created by 虞嘉伟 on 2025/2/18.
//  
  

#import "AppDelegate.h"
#import "CustomTabBarController.h"
#import "CYLTabBarControllerConfig.h"
#import <Bugly/Bugly.h>
//#import <PgySDK/PgyManager.h>
//#import <PgyUpdate/PgyUpdateManager.h>



@interface AppDelegate ()

@end

@implementation AppDelegate

- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
    // Override point for customization after application launch.
    
    [Bugly startWithAppId:@"ac1318771d"];
//    //启动基本SDK
//    [[PgyManager sharedPgyManager] startManagerWithAppId:@"a2e986801f94433d0cf1ac9c8cc2ad50"];
//    //启动更新检查SDK
//    [[PgyUpdateManager sharedPgyManager] startManagerWithAppId:@"a2e986801f94433d0cf1ac9c8cc2ad50"];
//    [[PgyUpdateManager sharedPgyManager] checkUpdate];
    self.window.rootViewController = [[UINavigationController alloc] initWithRootViewController:[NSClassFromString(@"SLLaunchViewController") new]];
    
    [NSNotificationCenter.defaultCenter addObserver:self selector:@selector(uploadIDFA) name:kNotificationNameIDFA object:nil];
    [Configuration config];
    return YES;
}

- (void)uploadIDFA {
    [NSNotificationCenter.defaultCenter removeObserver:self name:kNotificationNameIDFA object:nil];
    // 上报idfa，不管有值没值都要上报
    [GoogleMarketRequestProvider requestGoogleMarketTrackWithSuccess:^(NSDictionary * _Nonnull dict) {
        NSLog(@"idfa埋点上报成功");
    } failure:^(YTKRequest * _Nonnull request) {
        NSLog(@"idfa埋点上报失败");
    }];
}
- (void)applicationDidBecomeActive:(UIApplication *)application {
    [RequestCommonParameter idfa];
}

@end
